#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include "sysport.h"

void print_bytes (const sys_tchar *chars);

int main () {
	sys_tprintf ( _tx("sizeof sys_tchar = %lu\n"), sizeof(sys_tchar) );

	sys_tchar buff[1024];

	sys_tscanf ( _tx("%s"), buff );

	/* sys_tprintf ( _tx("%s\n"), buff ); */
	print_bytes (buff);
}

void print_bytes (const sys_tchar *chars) {
	size_t i;

	size_t len_bytes = sys_tstrlen (chars) * sizeof(sys_tchar);

	sys_byte *ptr_byte = (sys_byte *)chars;

	for (i = 0; i < len_bytes; i++) {
		sys_tprintf ( _tx("%X "), ptr_byte[i] );
	}
	sys_tprintf ( _tx("\n") );
}
